package com.BMS.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.BMS.DAOImpl.ManagerDaoImpl;
import com.BMS.DAOImpl.ReaderDaoImpl;
import com.BMS.Service.UserService;
import com.BMS.entity.Manager;
import com.BMS.entity.Reader;

/**
 * 用户业务层接口实现类
 * @author lenovo
 *
 */

@Transactional
@Service("UserService")
public class UserServiceImpl implements UserService {

	@Autowired
	public ReaderDaoImpl readerDao;
	
	@Autowired
	public ManagerDaoImpl managerDao;
	
	@Override
	public void addReader(Reader reader) {
		readerDao.addReader(reader);
	}

	@Override
	public void addManager(Manager manager) {
		managerDao.addManager(manager);
	}

	@Override
	public void deleteReader(String reader_id) {
		readerDao.deleteReaderById(reader_id);
	}

	@Override
	public void deleteManager(String manager_id) {
		managerDao.deleteManagerById(manager_id);
	}

	@Override
	public Reader findReaderById(String reader_id) {
		return readerDao.findReaderById(reader_id);
	}

	@Override
	public Manager findManagerById(String manager_id) {
		return managerDao.findManagerById(manager_id);
	}

	@Override
	public void updateReader(Reader reader) {
		readerDao.updateReader(reader);
	}

	@Override
	public void updateManager(Manager manager) {
		managerDao.updateManager(manager);
	}

}
